package clientmgl;

import java.awt.BorderLayout;


import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;

public class IdDialog extends JDialog{
	
	JLabel label;
	JTextField textField;
	JButton buttonOk;
	
	public IdDialog (JFrame frame){
		super(frame,"Envio ID");
		setVisible(true);
		
		
		setLayout(new BorderLayout());
		
		label= new JLabel("Inserte ID: ");
		textField = new JTextField();
		buttonOk= new JButton("OK");
		
		add(label,BorderLayout.NORTH);
		add(textField,BorderLayout.NORTH);
		add(buttonOk,BorderLayout.SOUTH);
		
		pack();
		
		//setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE);
		
	}

	public JButton getButtonOk() {
		return buttonOk;
		
	}

	public int getClientId() {
		
		return Integer.parseInt(textField.getText());
	}

}
